package hu.diploma.web.server.restlet.resources;

import hu.diploma.common.service.CallsService;
import hu.diploma.common.vos.CallVo;
import hu.diploma.core.util.ServiceProviderImpl;

import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

import com.google.gson.Gson;

public class JsonTest extends ServerResource {
	CallsService callsService = ServiceProviderImpl.getServiceProvider().getCallService();

	@Get("json")
	public CallVo getcallvCallVo() throws Exception {
		String call = (String) getRequest().getAttributes().get("call");
		Gson gson = new Gson();
		CallVo vo = gson.fromJson(call, CallVo.class);
		return callsService.save(vo);
	}

}
